//
//  MoreViewController.m
//  BookRank
//
//  Created by wststar on 13-10-19.
//  Copyright (c) 2013年 wststar. All rights reserved.
//

#import "MoreViewController.h"
#import "ThemeViewController.h"


@implementation MoreViewController


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
  if (self) {
        // Custom initialization
      self.title = NSLocalizedString(@"More", @"More");
      //self.tabBarItem = [[UITabBarItem alloc]initWithTitle: self.title image:[UIImage imageNamed:@"tabbar_more.png"] tag:4];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    _tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    [self.view addSubview:_tableView];
}


#pragma mark ---UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString * themeIdentifier = @"themeIdentifier";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:themeIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:themeIdentifier]autorelease];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    if (indexPath.row == 0) {
        cell.textLabel.text = @"主题";
    }
    //取消选中时的蓝色背景
    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    return cell;
}

#pragma mark --UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row ==0) {
        ThemeViewController * themeView = [[[ThemeViewController alloc]init]autorelease];
        [self.navigationController pushViewController:themeView animated:YES];

    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    [_tableView release];
    _tableView = nil;
}

@end
